package com.cx.mapper;

import com.cx.dto.AllHotel;
import com.cx.dto.ElasticSearchDto;
import com.cx.dto.HotelInfo;
import com.cx.dto.RecentHotel;
import com.cx.pojo.Hotel;
import com.cx.pojo.HotelExample;
import java.util.List;

import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface HotelMapper {
    int countByExample(HotelExample example);

    int deleteByExample(HotelExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Hotel record);

    int insertSelective(Hotel record);

    List<Hotel> selectByExample(HotelExample example);

    Hotel selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Hotel record, @Param("example") HotelExample example);

    int updateByExample(@Param("record") Hotel record, @Param("example") HotelExample example);

    int updateByPrimaryKeySelective(Hotel record);

    int updateByPrimaryKey(Hotel record);

    List<RecentHotel> findRecentHotelByCity(String cityName);

    List<HotelInfo> findHotelInfoBYHotelName(String hotelName);
    //根据用户选择的查询条件就行筛选数据库里面的酒店
    List<AllHotel> findHotelByCondition(@Param("locate") String [] locate, @Param("brand") String [] brand, @Param("mininumcharge") String [] mininumCharge, @Param("service") String [] service,@Param("priceflag") boolean priceflag,@Param("scoreflag") boolean scoreflag);


    //根据搜索框的内容对酒店就行排查
    List<AllHotel>findHotelByKeyWords(String keyWords);


    //ElasticSeacrh测试
    List<ElasticSearchDto> findAllHotel();



    //根据用户评论更新酒店评分

    void updateHotelScore(@Param("0") Integer id,@Param("1") double hotelScore);
}